package com.example.uhpocketguide;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}
	
	/** Called when the user clicks the Bathrooms button */
	public void pickBathroomMap(View view) {
	    // Do something in response to button
		Intent intent = new Intent(this, OpenBathroomMap.class);
		startActivity(intent);
	}
	
	/** Called when the user clicks the Call Boxes button */
	public void pickCallboxMap(View view) {
	    // Do something in response to button
		Intent intent = new Intent(this, OpenCallboxMap.class);
		startActivity(intent);
	}
	
	/** Called when the user clicks the Food button */
	public void pickFoodMap(View view) {
	    // Do something in response to button
		Intent intent = new Intent(this, OpenFoodMap.class);
		startActivity(intent);
	}
	
	/** Called when the user clicks the Shuttles button */
	public void pickShuttleMap(View view) {
	    // Do something in response to button
		Intent intent = new Intent(this, OpenShuttleMap.class);
		startActivity(intent);
	}
	
	/** Called when the user clicks the Campus Security button */
	public void dialCampusSecurity(View view) {
	    // Do something in response to button
		Intent intent = new Intent(Intent.ACTION_DIAL);
		intent.setData(Uri.fromParts("tel", "8089566911", "#")); 
		startActivity(intent); 
	}
	
	/** Called when the user clicks the General Services button */
	public void pickGeneralServicesList(View view) {
	    // Do something in response to button
		Intent intent = new Intent(this, OpenGeneralServicesList.class);
		startActivity(intent);
	}
	
	/** Called when the user clicks the Academic Departments button */
	public void pickAcademicDepartmentsList(View view) {
	    // Do something in response to button
		Intent intent = new Intent(this, OpenAcademicDepartmentsList.class);
		startActivity(intent);
	}
	
	/** Called when the user clicks the Stay Raining in Manoa? button */
	public void openStayRainingInBrowser(View view) {
	    // Do something in response to button
		String url_stayraining = new String("http://mobile.twitter.com/stayraining");
		Intent intent = new Intent(Intent.ACTION_VIEW);
		intent.setData(Uri.parse(url_stayraining));
		startActivity(intent);
	}
	
	// Disabled: Twitter profile not displaying correcting in WebView
/*	Called when the user clicks the Stay Raining in Manoa? (in app) button
	public void openStayRainingInApp(View view) {
	    // Do something in response to button
		Intent intent = new Intent(this, OpenStayRainingInApp.class);
		startActivity(intent);
	}*/
	


}
